package com.hx.study.service.impl;

import java.util.List;

import com.hx.study.domain.QuestionAnswer;
import com.hx.study.mapper.QuestionAnswerMapper;
import com.hx.study.service.IQuestionAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 候选答案Service业务层处理
 *
 * @author user
 * @date 2022-06-06
 */
@Service
public class QuestionAnswerServiceImpl implements IQuestionAnswerService {
    @Autowired
    private QuestionAnswerMapper questionAnswerMapper;

    /**
     * 查询候选答案
     *
     * @param id 候选答案主键
     * @return 候选答案
     */
    @Override
    public QuestionAnswer selectQuestionAnswerById(Integer id) {
        return questionAnswerMapper.selectQuestionAnswerById(id);
    }

    /**
     * 查询候选答案列表
     *
     * @param questionAnswer 候选答案
     * @return 候选答案
     */
    @Override
    public List<QuestionAnswer> selectQuestionAnswerList(QuestionAnswer questionAnswer) {
        return questionAnswerMapper.selectQuestionAnswerList(questionAnswer);
    }

    /**
     * 新增候选答案
     *
     * @param questionAnswer 候选答案
     * @return 结果
     */
    @Override
    public int insertQuestionAnswer(QuestionAnswer questionAnswer) {
        return questionAnswerMapper.insertQuestionAnswer(questionAnswer);
    }

    /**
     * 修改候选答案
     *
     * @param questionAnswer 候选答案
     * @return 结果
     */
    @Override
    public int updateQuestionAnswer(QuestionAnswer questionAnswer) {
        return questionAnswerMapper.updateQuestionAnswer(questionAnswer);
    }

    /**
     * 批量删除候选答案
     *
     * @param ids 需要删除的候选答案主键
     * @return 结果
     */
    @Override
    public int deleteQuestionAnswerByIds(Integer[] ids) {
        return questionAnswerMapper.deleteQuestionAnswerByIds(ids);
    }

    /**
     * 删除候选答案信息
     *
     * @param id 候选答案主键
     * @return 结果
     */
    @Override
    public int deleteQuestionAnswerById(Integer id) {
        return questionAnswerMapper.deleteQuestionAnswerById(id);
    }
}
